Skip to content

feat: enhance opportunityMatches query with status filtering and total count#3328

Merged
idoshamun merged 2 commits intomainfrom
matches-tweaks
Dec 9, 2025
Merged

feat: enhance opportunityMatches query with status filtering and total count#3328
idoshamun merged 2 commits intomainfrom
matches-tweaks

Conversation

@idoshamun
Copy link
Copy Markdown
Member

  • Added optional status filter to the opportunityMatches query.
  • Updated OpportunityMatchConnection to include totalCount for matches.

…l count

- Added optional status filter to the opportunityMatches query.
- Updated OpportunityMatchConnection to include totalCount for matches.
@pulumi
Copy link
Copy Markdown

pulumi Bot commented Dec 8, 2025

🍹 The Update (preview) for dailydotdev/api/prod (at 10c3211) was successful.

Resource Changes

    Name                                                   Type                           Operation
~   vpc-native-post-analytics-clickhouse-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tags-str-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-deployment              kubernetes:apps/v1:Deployment  update
-   vpc-native-api-db-migration-023eb320                   kubernetes:batch/v1:Job        delete
~   vpc-native-update-tag-recommendations-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-validate-active-users-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-generate-search-invites-cron                kubernetes:batch/v1:CronJob    update
~   vpc-native-private-deployment                          kubernetes:apps/v1:Deployment  update
~   vpc-native-hourly-notification-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-images-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-updated-sync-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-update-current-streak-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-update-views-cron                           kubernetes:batch/v1:CronJob    update
~   vpc-native-generic-referral-reminder-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-history-day-clickhouse-cron  kubernetes:batch/v1:CronJob    update
~   vpc-native-update-trending-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-user-companies-cron            kubernetes:batch/v1:CronJob    update
~   vpc-native-update-source-tag-view-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-daily-digest-cron                           kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-gifted-plus-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-ws-deployment                               kubernetes:apps/v1:Deployment  update
+   vpc-native-api-clickhouse-migration-fb0478f2           kubernetes:batch/v1:Job        create
+   vpc-native-api-db-migration-fb0478f2                   kubernetes:batch/v1:Job        create
~   vpc-native-clean-stale-user-transactions-cron          kubernetes:batch/v1:CronJob    update
~   vpc-native-update-source-public-threshold-cron         kubernetes:batch/v1:CronJob    update
~   vpc-native-bg-deployment                               kubernetes:apps/v1:Deployment  update
-   vpc-native-api-clickhouse-migration-023eb320           kubernetes:batch/v1:Job        delete
~   vpc-native-clean-zombie-opportunities-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-users-cron                     kubernetes:batch/v1:CronJob    update
~   vpc-native-check-analytics-report-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-deployment                                  kubernetes:apps/v1:Deployment  update
~   vpc-native-calculate-top-readers-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-sync-subscription-with-cio-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-update-highlighted-views-cron               kubernetes:batch/v1:CronJob    update
~   vpc-native-temporal-deployment                         kubernetes:apps/v1:Deployment  update

Comment thread src/schema/opportunity.ts Outdated
];

// Validate status if provided
if (args.status && !allowedStatuses.includes(args.status)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually validate payloads with zod parse now, much better and throws structured error to frontend as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll look for an example 🫡

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look at editOpportunity mutation in this same file

Comment thread src/schema/opportunity.ts
const statusesToFilter = args.status ? [args.status] : allowedStatuses;

const [connection, totalCount] = await Promise.all([
queryPaginatedByDate<GQLOpportunityMatch, 'updatedAt', typeof args>(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this now used for tinder style matching? Do we want to make sure user can't browse multiple candidates if doing direct API requests and requesting more candidates, and only do one by one? (could be something we add later, just for shenanigans protection) 😆

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be strict to actually protected from it. But we also have couple use cases where we actually show a list, not just one by one. so it's better to support it this way

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do we show it as list? (just for my own reference)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it doesn't exist at the moment, but i know we plan to show recruiter approved/rejected candidates

@idoshamun idoshamun merged commit da5e98b into main Dec 9, 2025
9 checks passed
@idoshamun idoshamun deleted the matches-tweaks branch December 9, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants